home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
25
/
applic
/
tinyview.doc
< prev
next >
Wrap
Text File
|
1986-06-19
|
6KB
|
93 lines
Tiny Stuff and Tiny View
by David Mumper
ST Picture Compression
Any ST user who has pictures knows that, no matter how good (or bad) they
look, they always take roughly 32128 bytes of disk space. This can be quite
discouraging when you realize that this means that you can only fit 10 pictures
on a single sided disk. From NeoChrome 0.5, the memory is used as follows...
4 bytes telling the resolution (0=low, 1=medium, 2=high)
32 bytes for the colors
12 bytes set aside for a filename (always " . ")
2 bytes telling which colors are set for rotating (first is always $80)
2 bytes telling the speed and direction of rotation
2 bytes telling how long to rotate
74 reserved bytes (for expansion)
32000 bytes of screen memory
-----
32128 total
A more efficient way of saving the pictures would be to do a compression on
the screen memory so that, if there were repetative sections, it wouldn't be as
long. An example of how to do this could be to look at the Micro-Illustrator
(Koala pad) compaction for the 8-bit computers. A straight memory save of a
Graphics 8 (or 15) screen would take up 7680 bytes. Saving a picture with the
Micro-Illustrator format can result in a picture as small as 32 bytes (if the
screen was blank). This type of compression could be applied to the ST as well
resulting in very large memory savings. TINYSTUFF is an implementation of just
such a compression algorhythm that produces an average compression of about 64%.
Comparing it to the Micro-Illustrator format, it's smallest save would be 42
bytes.
USING THE COMPACTOR
To use the compactor program, place it on a freshly formatted disk and add
some pictures. For best results, place half as many uncompacted pictures on
the disk as you could actually fit (5 on single sided and 10 on double sided).
Next, double click on the compacter program. It will then load and begin
executing. The program will begin by asking you the formats for the pictures to
convert. As an additional feature, you can convert Degas format pictures to Neo
(or vice versa) as well as compacting or uncompacting them. After you have
chosen the source and destination formats for the pictures, the program will
begin loading all the pictures that match the source format from the same disk
and pathname as the program. The program will load and display each picture
that has the correct extender for that file type (i.e. '.NEO' for NeoChrome,
'.TNY' for Tiny or '.PI?' for Degas). As the program displays the pics, it will
convert them and save them back to the same disk / pathname as the program.
Each of the pictures will have the same name as they start with but the extender
will be changed to that of the destination format.
Having your picture collection in a compacted format is handy to save space
but is a nuisance if you can't look at them that way. Therefore, TINYVIEW is a
displayer program for pictures in Tiny format. To look at the pictures, just
place as many of them on a disk with the displayer program as will fit then
double click the display program. It will search the directory for the first
filename with a '.TNY' extender and then start displaying them from there. It
will load and display all the pictures on the disk, cycling back to the
beginning when the end of directory is reached. Pressing the space bar will
cause the program to pause and wait for another key to be pressed before going
on to the next picture. To exit the program, press any key other than the space
bar while not paused. The picture that is being loaded will be displayed and
then the program will return to the desktop. Any pictures that have color
rotation information, will have that saved with the picture when it's compacted
and displayed by this program.
The file format of the compacted files is as follows...
1 byte that tells which resolution and if there is rotation information
(if there is rotation information it is stored as follows
1 byte for the start and end color to rotate (start is high 4 bits
end is low 4 bits)
1 byte for direction and speed of rotation (negative for left
rotation positive for right, actual number is the number of
vertical blank interrupts to wait between each rotation)
2 bytes for the number of revolutions to make)
2 bytes that tell how many control bytes there are
2 bytes that tell how many data bytes there are
32 bytes that tell the computer the colors
3-10667 control bytes
2-32000 data bytes
-----
42-32044 minimum-maximum size
The screen is scanned column by column, plane by plane (assuming low res
format) as the program does the compaction.
If there is rotation information, the resolution has 3 added to it to
signify this.
Control bytes are interpreted as follows...
X < 0 -- 1-127 unique words are taken from the data section
X = 0 -- two more words are taken from the control section that is a value
128-32767 which is the number of times to repeat the next data word
X = 1 -- two more bytes are taken from the control section that is a value
128-32767 of unique words to take from data section
X > 1 -- 1 byte of repetative information is taken from data section and
repeated 2-127 times.
Due to this compression algorythm, I've been able to place as many as 95
pictures on a double sided disk. (That's an 850% improvement!! and not common)
Average disks will hold roughly 20-30 pictures. So far I've seen many very
nicely done pictures on bulletin boards and visiting friends, so hopefully, by
allowing the average user the ability to keep more pictures on less disks, we'll
all be able to see many more artists showing their abilities on the ST.